package Demo;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class Demo010 {
    public static void main(String[] args) {
        try (OutputStream is = new FileOutputStream("./文本txt",true)) {
            byte[] b = new byte[] {
                (byte) 'G', (byte) 'o', (byte) 'o', (byte) 'd', (byte) 'b', (byte) 'y', (byte) 'e', (byte) '!'
            };
            is.write(b);
            String s = "你好中国";
            byte[] b1 = s.getBytes("utf-8");
            is.write(b1);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
